<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>06子类选择器和后代选择器</title>
</head>
<body>
    
    <div id="father">
        <div id="o" class="green">01</div>
        <div>02
            <p>111</p>
            <p>222</p>
            <p>333</p>
        </div>
        <div>03</div>
        <div>04</div>
        <div>05</div>
        <p>66</p>
        <p>77</p>
        <p>88</p>
    </div>

    <script src="../jquery-3.2.1.js"></script>
    <script>
    
        $(function(){
            // 子代选择器
            $("#father>p").css("backgroundColor","hotpink");

            $("#father p").css("color","orange");

            // 交集选择器
            $("#o.green").css("backgroundColor","green");
            
        });
    
    
    </script>
</body>
</html>